import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {
        File file = new File("E:/新建文件夹/测试用例/test.txt");
        File file2 = new File("E:/新建文件夹/测试用例/Demo.txt");
        file.renameTo(file2);
        /*String[] s = file.list();
        System.out.println(Arrays.toString(s));*/
    }
    public static void main1(String[] args) throws IOException {
        File file = new File("E:/新建文件夹/测试用例/test.txt");
        System.out.println(file.getParentFile());
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());
        System.out.println(file.isAbsolute());
        file.delete();
        file.createNewFile();

    }
}
